<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <title>7-1 Transitions动画</title>
    <link rel="stylesheet" href="../common.css">
    <script src="../jquery-2.2.0.js"></script>
    <script src="../main.js"></script>
    <style>
        div{
            width:300px;
            height:240px;
            padding: 20px;
            margin: 20px 30px;
            border:2px solid black;
            display: inline-block;
            color: #fff;
            text-shadow: 1px 1px 2px black;
            font-family: 微软雅黑;
            font-weight: bold;
            background-color: skyblue;
            vertical-align: top;
            white-space: pre-wrap;
            /*不写浏览器兼容的话谷歌和IE也可以，其他未测试*/
            transition: background-color 1s linear,
                        color 1s linear,
                        transform 1s linear;
        }
        code{
            text-shadow: none;
        }
        #Transitions div:nth-of-type(1):hover{
            background-color: darkblue;
        }

        #Transitions div:nth-of-type(2):hover{
            background-color: darkblue;
            transform: rotate(30deg) ;
            color: #f80;
        }

        #Transitions img{
            margin:30px;
            transition: transform 2s ease;
        }
        #Transitions img:hover{
            background-color: darkblue;
            transform: rotate(360deg) scale(3);
            color: #f80;
        }

        #Transitions div:nth-of-type(3){
            position: relative;
            width: 240px;
            border-radius:0 0 0 100%;
            transform: rotate(-15deg);
            transform-origin: right top;
            transition: transform 1s ease ;

        }
        #Transitions div:nth-of-type(3):hover {
            transform: rotate(-75deg);
        }
    </style>

</head>
<body>

<h1>7-1 Transitions动画</h1>
<h3>transitions动画</h3>
<section id="Transitions">
    共同的动画属性：
<code>transition: background-color 1s linear,
    color 1s linear,
    transform 1s linear;
</code>
    <br>
    <div>单个属性的变化：
        <code>background-color: darkblue;</code>
    </div>
    <div>多个属性的变化：
        <code>background-color: darkblue;
transform: rotate(30deg) ;
color: #f80;
        </code>
    </div><br>给图像做动画
    <code>transition: transform 2s ease;</code><br>
    <code>:hover {
        background-color: darkblue;
        transform: rotate(360deg) scale(3);
        color: #f80;
    }</code><br>
    <img src="../05backgroundAndBorder/redBgFlower.jpg">
    <br>
    <code>transform: rotate(-15deg);
    transform-origin: right top;
    transition: transform 1s ease ;</code><br>
    <code>:hover {
        transform: rotate(-75deg);
        }
    </code>
    <br>
    <div>单摆,鼠标移上去摆到右边，移走摆回左边
        </div>
</section>

</body>
</html>